'''
@Author: your name
@Date: 2020-03-21 22:34:03
@LastEditTime: 2020-03-21 22:55:53
@LastEditors: Please set LastEditors
@Description: In User Settings Edit
@FilePath: \giee\learn_python\爬虫\爬虫基础\练习项目\json的练习.py
'''

import json

str = '{"name":"小明"}'
ojb = json.loads(str)
print(ojb)

str_2 = json.dumps(ojb, ensure_ascii=False)  # 关闭转换为assck码
print(type(str_2), ":", str_2)

json.dump(ojb, open("move.txt", "w", encoding="utf-8"), ensure_ascii=False)
str_3 = json.load(open("move.txt", encoding="utf-8"))
print(str_3)